  <template>
  <div>
  <!-- 县仓管理 -->
    <div v-show="isShow">
      <i class="el-icon-back" @click="goBack" style="padding:2%;cursor: pointer;">返回 | 添加商品</i>
      <AddGood :proInfo="proInfo"/>
    </div>
    <div v-show="!isShow" class="sr-container" style="margin:20px">
      <el-button type="primary" @click="addCountyStorage">新增县仓</el-button>
      <el-button type="success" @click="handlerRecord1" style="float:right">补货记录</el-button>
      <el-button type="primary" @click="handlerRecord" style="float:right">仓储记录</el-button>
      <div class="filter-container" style="margin-top:20px;">
        <span style="float:left;margin-top:5px;margin-left:2%">仓库：</span>
        <el-select style="width: 200px;float:left" size="small" v-model="search.mainWarehouse" placeholder="选择仓库" clearable>
          <el-option
            v-for="item in mainWarehouseList"
            :key="item.warehouseId"
            :label="item.name"
            :value="item.warehouseId"
          ></el-option>
        </el-select>
        <p style="float:left;margin-top:5px;margin-left:2%">负责人：</p>
        <el-input
          v-model="search.linkman"
          size="small"
          placeholder="请输入负责人"
          style="width: 200px;float:left"
          class="filter-item"
          @keyup.enter.native="handleFilter"
        />
        <p style="float:left;margin-top:5px;margin-left:2%">联系电话：</p>
        <el-input
          v-model="search.phone"
          size="small"
          placeholder="请输入联系电话"
          style="width: 200px;float:left"
          class="filter-item"
          @keyup.enter.native="handleFilter"
        />
        <el-button
          size="small"
          class="filter-item"
          type="success"
          icon="el-icon-search"
          style="margin-left:3%"
          @click="handleFilter"
        >
          搜索
        </el-button>
      </div>
      <el-table :data="countyList" style="width: 100%;margin-top:15px;padding-bottom:2%" tooltip-effect="dark" border>
        <el-table-column type="index" min-width="50" label="序号" align="center"></el-table-column>
        <el-table-column prop="name" label="仓库" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.name }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="仓库负责人" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.linkman }}</span>
          </template>
        </el-table-column>
        <el-table-column label="联系电话" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.phone }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="id" label="仓库地址" min-width="250px" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.adress }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="库存" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.amount }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="{ row }">
            <el-button type="primary" size="small"  @click="handlerCheck(row)">查看详情</el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination v-show="search.total > 0" :total="search.total" :page.sync="search.pageNum"
      :limit.sync="search.pageSize" @pagination="getList" />
      <!-- 新增县仓 -->
      <el-dialog title="新增县仓" :visible.sync="isAddDialogVisible" width="60%" append-to-body @close="loadPage">
        <div style="margin-left:2%;padding-bottom:40px;min-height: 300px;">
          <!-- 添加商品时要隐藏的部分start -->
          <div>
            <el-form
              ref="dataForm"
              label-position="left"
              label-width="150px"
              style="width: 900px; margin-left:50px;"
            >
              <el-form-item label="县仓地址：">
                <el-select v-model="checkProvinceData" value-key="code"  placeholder="省" @change="changeProvince">
                  <el-option v-for="item in provinceAllList" :key="item.code" :label="item.name" :value="item">
                  </el-option>
                </el-select>
                <el-select v-model="checkCityData" value-key="code" placeholder="市" @change="changeCity">
                  <el-option v-for="item in cityAllList" :key="item.code" :label="item.name" :value="item">
                  </el-option>
                </el-select>
                <el-select v-model="checkCountyData" value-key="code" placeholder="区" @change="changeCounty">
                  <el-option v-for="item in countyAllList" :key="item.code" :label="item.name" :value="item">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="县仓经理：">
                <el-input v-model="addFormData.linkman" placeholder="请输入县仓经理姓名" size="small" class="fliter-item" style="width:200px"></el-input>
              </el-form-item>
              <el-form-item label="县仓名称：">
                <el-input v-model="addFormData.name" placeholder="请输入县仓经理姓名" size="small" class="fliter-item" style="width:200px"></el-input>
              </el-form-item>
              <el-form-item label="联系电话：">
                <el-input v-model="addFormData.phone" placeholder="请输入联系人电话" size="small" class="fliter-item" style="width:200px"></el-input>
              </el-form-item>
            </el-form>
          </div>


          <!-- 新增县仓-->
          <div slot="footer" style="float:right;margin-bottom:20px;">
            <el-button type="primary" @click="saveCityStorage()">新增县仓</el-button>
          </div>
        </div>
      </el-dialog>


      <!-- 仓储记录 -->
      <el-dialog title="仓储记录" :visible.sync="isReportVisible" width="80%" append-to-body :close-on-click-modal="false" @close="loadPage">
        <div>
          <span style="margin-left:5px;">调货时间:</span>
          <el-date-picker v-model="dialogForm.transferTime" type="datetimerange" range-separator="——" start-placeholder="点击展开日历列表"
            end-placeholder="点击展开日历列表" size="small" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
          <el-button size="small" style="margin-left:3%;" class="filter-item" type="success" icon="el-icon-search" @click="getReportList">查询</el-button>
          <el-table :data="recordData" style="width: 100%;margin-top:15px;padding-bottom:2%" tooltip-effect="dark" border>
            <el-table-column type="index" min-width="50" label="序号" align="center"></el-table-column>
            <el-table-column prop="name" label="调入仓" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.inStorageName }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="调出仓" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.outStorageName }}</span>
              </template>
            </el-table-column>
            <el-table-column label="调货商品" min-width="250px" align="center">
              <template slot-scope="scope">
                <div style="dispaly:table;margin:0 auto;height:100px;align-content: center">
                  <el-image style="width: 100px; height: 100px;margin-right:10px;float:left" :src="scope.row.amgurl" fit
                    lazy></el-image>
                  <div>
                    <p align="left" style="margin-bottom:20px;">商品名称：{{ scope.row.proName }}</p>
                    <p align="left" style="margin-bottom:0px;">商品型号：{{ scope.row.proType }}</p>
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="id" label="调货数量" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.number }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="操作人" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.operator }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="price" label="时间" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.time }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="说明" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.node }}</span>
              </template>
            </el-table-column>
          </el-table>
          <pagination v-show="reportTotal > 0" :total="reportTotal" :page.sync="record.pageNum" :limit.sync="record.pageSize"
            @pagination="handlerRecord" />
        </div>
      </el-dialog>



      <!-- 县仓详情 -->
      <el-dialog :title="countyDesForm.dialogTitle" :visible.sync="countyDesForm.isDesVisible" width="80%" append-to-body>

        <!-- 商品列表 -->
        <div v-show="!countyDesForm.isShowTransfer">
          <span>商品类型：</span>
          <el-select v-model="countyDesForm.catId" placeholder="选择商品" clearable>
            <el-option v-for="item in goodType" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
          <span style="margin-left:2%">商品品牌：</span>
          <el-input v-model="countyDesForm.goodsBrand" placeholder="请输入商品品牌" size="small" class="fliter-item" style="width:200px"
            @keyup.enter.native="getCountyDesList"></el-input>
          <span style="margin-left:2%">商品名称：</span>
          <el-input v-model="countyDesForm.infoName" placeholder="请输入商品名称" size="small" class="fliter-item" style="width:200px"
            @keyup.enter.native="getCountyDesList"></el-input>
          <el-button size="small" style="margin-left:3%;" class="filter-item" type="success" icon="el-icon-search" @click="getCountyDesList">查询</el-button>
          <!-- 县仓列表 -->
          <el-table :data="proDataList" style="width: 100%;margin-top:15px" tooltip-effect="dark" border>
            <el-table-column label="序号" min-width="50" align="center" type="index"></el-table-column>
            <el-table-column label="商品编码" align="center" prop="goodCode">
              <template slot-scope="scope">
                <span>{{ scope.row.proCode }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品" min-width="250px" align="center">
              <template slot-scope="scope">
                <div style="dispaly:table;margin:0 auto;height:100px;align-content: center">
                  <el-image style="width: 100px; height: 100px;margin-right:10px;float:left" :src="scope.row.imageUrl"
                    fit lazy></el-image>
                  <div>
                    <p align="left" style="margin-bottom:20px;">商品名称：{{ scope.row.infoName }}</p>
                    <p align="left" style="margin-bottom:0px;">商品型号：{{ scope.row.proType }}</p>
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="商品类型" align="center" prop="goodType">
              <template slot-scope="scope">
                <span>{{ scope.row.proCatName }}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品品牌" align="center" prop="brand">
              <template slot-scope="scope">
                <span>{{ scope.row.goodsBrand}}</span>
              </template>
            </el-table-column>
            <el-table-column label="市场价" min-width="100px" align="center">
              <template slot-scope="{row}">
                <span>{{row.proMarketPrice}}</span>
              </template>
            </el-table-column>
            <el-table-column label="销售价" min-width="100px" align="center">
              <template slot-scope="{row}">
                <span>{{row.proSellPrice}}</span>
              </template>
            </el-table-column>
            <el-table-column label="商品状态" min-width="50px" align="center">
              <template slot-scope="{row}">
                <span>{{row.status==1?'上架':'下架'}}</span>
              </template>
            </el-table-column>
            <el-table-column label="库存" min-width="50px" align="center">
              <template slot-scope="{row}">
                <span>{{row.amount}}</span>
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center">
              <template slot-scope="{ row }">
                <el-button type="primary" size="small" @click="handlerTransfer(row)">调货</el-button>
              </template>
            </el-table-column>
          </el-table>


          <pagination v-show="countyDesForm.total > 0" :total="countyDesForm.total" :page.sync="countyDesForm.pageNum"
            :limit.sync="countyDesForm.pageSize" @pagination="getCountyDesList" />
        </div>

        <!-- 调货Dialog -->
        <el-dialog title="请填写入仓调货清单" :visible.sync="isTransferVisible" width="60%" append-to-body :close-on-click-modal="false">
          <div>
            <div>
              <span style="margin-left:5px;">出货仓库：</span>
              <el-table :data="dataList" tooltip-effect="dark" ref="tableData" @row-click="singleElection" stripe border
                style="width:100%">
                <el-table-column prop="prop" label="单选" align="center">
                  <template slot-scope="scope">
                    <el-radio class="radio" v-model="templateSelection" :label="scope.$index">&nbsp;</el-radio>
                  </template>
                  <!-- v-model="scope.row.id == transferForm.selectedId" -->
                </el-table-column>
                <el-table-column prop="name" label="省" align="center">
                  <template slot-scope="scope">
                    <span>{{scope.row.province}}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="name" label="市" align="center">
                  <template slot-scope="scope">
                    <span>{{scope.row.city}}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="name" label="县" align="center">
                  <template slot-scope="scope">
                    <span>{{scope.row.name}}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="id" label="该商品库存" align="center">
                  <template slot-scope="scope">
                    <span>{{scope.row.amount}}</span>
                  </template>
                </el-table-column>
              </el-table>
              <pagination v-show="total > 0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize"
                @pagination="handlerTransfer" />
            </div>

            <div style="margin-top:2%;display:flex;align:center">
              <span>调货数量：</span>
              <el-input v-model="transferForm.transferNum" placeholder="请输入调货数量" size="small" class="fliter-item" style="width:200px"></el-input>
            </div>
            <div style="margin-top:2%;display:flex;align:center">
              <span>调货说明：</span>
              <el-input type="textarea" :rows="2" size="small" style="width:50%" placeholder="请输入内容" v-model="transferForm.transferDes"></el-input>
            </div>
          </div>
          <div slot="footer">
            <el-button type="primary" @click="addTiaohuo">确 定</el-button>
          </div>
        </el-dialog>

      </el-dialog>
      <el-dialog
        title="补货记录"
        :visible.sync="recordForm.isShowRecord"
        width="80%"
        append-to-body
        :close-on-click-modal="false"
        @close="loadPage"
      >
        <div>
          <span style="margin-left:5px;">补货时间:</span>
          <el-date-picker
            v-model="recordForm.transferTime"
            type="datetimerange"
            range-separator="——"
            start-placeholder="点击展开日历列表"
            end-placeholder="点击展开日历列表"
            size="small"
            value-format="yyyy-MM-dd HH:mm:ss"
          ></el-date-picker>
          <el-button
            size="small"
            style="margin-left:3%;"
            class="filter-item"
            type="success"
            icon="el-icon-search"
            @click="getRecordList1"
          >查询</el-button>
          <el-table
            :data="buhuoDataList"
            style="width: 100%;margin-top:15px;padding-bottom:2%"
            tooltip-effect="dark"
            border
          >
            <el-table-column type="index" min-width="50" label="序号" align="center"></el-table-column>
            <el-table-column label="调货商品" min-width="180px" align="center">
              <template slot-scope="scope">
                <div style="dispaly:table;margin:0 auto;height:100px;align-content: center">
                  <el-image
                    style="width: 150px; height: 100px;margin-right:10px;float:left"
                    :src="scope.row.imageUrl"
                    fit
                    lazy
                  ></el-image>
                  <div>
                    <p align="left" style="margin-bottom:20px;">商品名称：{{ scope.row.infoName }}</p>
                    <p align="left" style="margin-bottom:0px;">商品型号：{{ scope.row.proType }}</p>
                  </div>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="id" label="补货数量" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.number}}</span>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="操作人" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.operator}}</span>
              </template>
            </el-table-column>
            <el-table-column prop="price" label="时间" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.createTime}}</span>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="说明" min-width="150px" align="center">
              <template slot-scope="scope">
                <span>{{ scope.row.note}}</span>
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="recordForm.total > 0"
            :total="recordForm.total"
            :page.sync="recordForm.pageNum"
            :limit.sync="recordForm.pageSize"
            @pagination="handlerRecord1"
          />
        </div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
  import Pagination from "@/components/Pagination";
  import AddGood from "./addGood";
  import {
    getAreaCode, //获取省，区
    getCityStorageList, //获取市
    saveCityStorage, //保存
    getCountyData, //查询县仓
    getAllCounty,
    getRecordList,
  } from '@/api/countyStorageReq'
  import {
    getMainStorage,
    getcangkuList,
    getSeasoning,
    seasoningCondiments,
    getSumList,
    getStorageAddRecList
  } from '@/api/mainStorage'
  import {
    getCountyStorage,
  } from '@/api/countyStorage'
  export default {
    inject: ["reload"],
    watch: {

      //调货的dialog标题判断
      "countyDesForm.isShowTransfer": function(old, now) {
        old
          ?
          (this.countyDesForm.dialogTitle = "请填写入仓调货清单") :
          (this.countyDesForm.dialogTitle = "xxx县仓");
      },
      //调货的dialog消失就返回到县仓详情
      "countyDesForm.isDesVisible": function(old, now) {
        if (!old) {
          this.countyDesForm.isShowTransfer = false;
          this.countyDesForm.selectedId = -1;
        }
      }
    },
    components: {
      Pagination,
      AddGood, 
    },
    data() {
      return {
        buhuoDataList:null,
        recordForm: {
          isShowRecord: false,
          //调货时间
          transferTime: [],
          total: 0,
          pageNum: 1,
          pageSize: 10
        },
        mainWarehouseList:[],
        houseList: [],
        countyData: {}, //县仓信息
        provinceAllList: [], //省list
        cityAllList: [],
        countyAllList: [],
        checkProvinceData:{},
        checkCityData:{},
        checkCountyData: {},
        addFormData: {},
        loadingType: true,
        //显示增加县仓dialog
        isAddDialogVisible: false,
        //县仓详情
        countyDesForm: {
          dialogTitle: "xxx县仓",
          total: 0,
          //是否显示dialog
          isDesVisible: false,
          //是否开始调货
          isShowTransfer: false,
          pageNum: 1,
          pageSize: 10,
          goodsBrand: "", //商品品牌
          infoName: "", //商品名称
          catId: ''
        },

        isShow:false,
        //获取仓储记录列表

        recordData: null,
        countyList:null,
        //仓储记录
        record: {
          pageNum: 1,
          pageSize: 10,
        },
        reportTotal: 0,

        //仓储记录
        isReportVisible: false,
        //仓储记录时间查询
        dialogForm: {
          transferTime: []
        },


        myChart: null,

        //商品库
        proDataList: [],
        dataList: [],
        //商品类型
        goodType: [{
            label: "热水器",
            value: '737717c9-eb23-11e9-af14-7cd30ac0ab94'
          },
          {
            label: "空调",
            value: '24c306ee-b1a9-11e9-9cf4-105bad763570'
          }
        ],
        ss: "ewwe",



        //调货
        isTransferVisible: false,
        total: 0,
        listQuery: {
          pageNum: 1,
          pageSize: 10
        },
        search: {
          total:0,
          pageNum: 1,
          pageSize: 10,
          //仓库选择
          mainWarehouse: "",
          //商品类型
          
        },
        templateSelection: '',
        selectedkucun: '',
        oldkucun: '',
        oldWarehouse: '',
        //调货提交数据
        transferForm: {
          //调货单选
          selectedId: 0,
          transferNum: 0,
          transferDes: ""
        },
        proInfo:''
      };
    },
    mounted() {
      this.getList()
      this.getCountyData()
    },
    
    methods: {
      //添加县仓
      loadPage(){
        this.reload()
      },
      handleFilter() {
        this.search.page = 1
        this.getList()
      },
      getReportList() {
        this.record.pageNum = 1
        this.handlerRecord()
      },
      getList(){
        var params={
          pageNum:this.search.pageNum- 1,
          pageSize:this.search.pageSize,
          phone:this.search.phone,
          linkman:this.search.linkman,
          warehouseId:this.search.mainWarehouse
        }
        getAllCounty(params).then(res=>{
          this.countyList=res.data.content
          console.log(res)
          this.search.total=res.data.totalElements
        })
      },
      goBack() {
        this.isShow = false;
        this.reload()
      },
      handlerCheck(row){
        this.proInfo=row.warehouseId
        console.log(this.proInfo)
        // this.$refs.child.getProInfoList()
        this.isShow = true;
      },
      addCountyStorage() {
        this.isAddDialogVisible = true;
        this.addFormData = {}
        this.countyData = {}
        this.getAreaCode()
      },

      getAreaCode() {
        getAreaCode('-1').then(res => {
          this.provinceAllList = res.data
        })
      },
      // 选择省，并获取市
      changeProvince(res) {
        console.log(res)
        var formdata = {
          superAreaCode: res.code
        }
        this.checkProvinceData=res
        // 数据还原
        this.addFormData.province = res.name
        this.addFormData.province_code = res.code
        this.addFormData.city = ""
        this.addFormData.city_code = ""
        this.addFormData.county = ""
        this.addFormData.county_code = ""
        console.log('addFormData',this.addFormData)
        getCityStorageList(formdata.superAreaCode).then(result => {
          console.log('市', result)
          this.cityAllList = result.data
        })
      },
      changeCity(res) {
        console.log('选择是',res)
        this.checkCityData=res
        this.addFormData.city = res.name
        this.addFormData.city_code = res.code
        this.addFormData.county = ""
        this.addFormData.county_code = ""
        console.log('addFormData',this.addFormData)
        getAreaCode(res.code).then(res => {
          console.log(this.countyAllList)
          this.countyAllList = res.data
        })
      },

      // 选择区县
      changeCounty(res) {
        this.checkCountyData = res
        this.addFormData.county = res.name
        this.addFormData.county_code = res.code
        console.log('addFormData',this.addFormData)
      },
      // 保存县仓
      saveCityStorage() {
        var formdata = this.addFormData
        saveCityStorage(formdata).then(res => {
          if (res.code === '200') {
            this.$notify({
              title: '成功',
              message: '县仓添加成功',
              type: 'success',
              duration: 2000
            })
            this.countyData = this.addFormData
          } else {
            this.$notify({
              title: '失败',
              message: '失败，请联系管理员',
              type: 'danger',
              duration: 2000
            })
          }
          this.reload()
        })
      },


      //获取县仓信息
      getCountyData() {
        getCountyData().then(res => {
          if (res.code === '200') {
            this.mainWarehouseList=res.data
          } else {
            this.$notify({
              title: '失败',
              message: '失败，请联系管理员',
              type: 'danger',
              duration: 2000
            })
          }
        })
      },



      //仓储记录dialog
      handlerRecord() {
        this.isReportVisible = true;
        if (this.dialogForm.transferTime !== null) {
          if (this.dialogForm.transferTime.length >= 2) {
            this.startTime = this.dialogForm.transferTime[0]
            this.endTime = this.dialogForm.transferTime[1]
          } else {
            this.startTime = ''
            this.endTime = ''
          }
        } else {
          this.startTime = ''
          this.endTime = ''
        }

        var params = {
          pageNum: this.record.pageNum-1,
          pageSize: this.record.pageSize,
          startTime: this.startTime,
          endTime: this.endTime,

        }
        getRecordList(params).then(res => {
          this.recordData = res.content
          this.reportTotal = res.totalElements
        })
      },
      handlerRecord1() {
        this.recordForm.isShowRecord = true;
        if(this.recordForm.transferTime!==null){
            if(this.recordForm.transferTime.length>=2){
              this.startTime=this.recordForm.transferTime[0]
              this.endTime=this.recordForm.transferTime[1]
            }else{
              this.startTime=''
              this.endTime=''
            }
          }else{
            this.startTime=''
            this.endTime=''
          }
        var params={
          pageSize:this.recordForm.pageSize,
          pageNum:this.recordForm.pageNum-1,
          startTime:this.startTime,
          endTime:this.endTime
        }
        getStorageAddRecList(params).then(res=>{
          this.buhuoDataList=res.content
          this.recordForm.total=res.totalElements
        })
      },
    getRecordList1() {
      this.recordForm.pageNum = 1
      this.handlerRecord1()
    },


      //跳转到县仓详情
      countyDes() {
        this.countyDesForm.isDesVisible = true;
        this.getCountyDesList()
      },
      //获取县仓详情数据
      getCountyDesList() {
        var areacode = sessionStorage.getItem('areacode')
        var data = {
          areaCode: areacode,
          pageNum: this.countyDesForm.pageNum-1,
          pageSize: this.countyDesForm.pageSize,
          goodsBrand: this.countyDesForm.goodsBrand,
          infoName: this.countyDesForm.infoName,
          catId: this.countyDesForm.catId
        }

        getCountyStorage(data).then(res => {
          this.proDataList = res.content
          this.countyDesForm.total = res.totalElements
          this.countyDesForm.dialogTitle=res.content[0].name
        })
      },


      //单选
      bindCheckBox(row) {
        this.transferForm.selectedId = row.id;
      },


      //调货
      handlerTransfer(row) {


        this.isTransferVisible = true;
        var params = Object.assign({}, row)
        this.oldWarehouse = row.storageId
        this.oldkucun = row.amount
        this.$set(params, 'pageSize', this.listQuery.pageSize)
        this.$set(params, 'pageNum', this.listQuery.pageNum-1)
        console.log('调货', params)
        getSeasoning(params).then(res => {
          this.dataList = res.content
          this.total = res.totalElements
        })
      },
      singleElection(row) {
        this.templateSelection = this.dataList.indexOf(row);
        console.log(this.templateSelection)
        this.selectedList = row
        this.templateRadio = row.storageId;
        this.selectedkucun = row.amount
      },
      addTiaohuo() {
        console.log(this.templateRadio)
        var addTemp = {
          oldStorageId: this.oldWarehouse,
          newStorageId: this.templateRadio,
          oldProAmount: this.oldkucun,
          newProAmount: this.selectedkucun,
          exchangeAmount: this.transferForm.transferNum,
          exchangeReason: this.transferForm.transferDes
        }
        seasoningCondiments(addTemp).then(res => {
          if (res.code === '200') {
            this.$notify({
              title: '成功',
              message: '调货成功',
              type: 'success',
              duration: 2000
            })
            // this.isTransferVisible = false;
            this.reload()
          } else {
            this.$notify({
              title: '失败',
              message: '失败，请联系管理员',
              type: 'danger',
              duration: 2000
            })
          }
          this.getCountyDesList()
        })
      },

    }
  };
</script>
<style>
  .el-select{
    width: 150px
  }
  .el-select-dropdown{
    min-width: 150px
  }
</style>